<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html lang="zh">
    
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>主页</title>
        <style>
    .up {
     width:100px;
     text-align:center;
     line-height:100%;
     padding:0.3em;
     font:16px Arial,sans-serif bold;
     font-style:normal;
     text-decoration:none;
     margin:2px;
     vertical-align:text-bottom;
     zoom:1;
     outline:none;
     font-size-adjust:none;
     font-stretch:normal;
     border-radius:50px;
     box-shadow:0px 1px 2px rgba(0,0,0,0.2);
     text-shadow:0px 1px 1px rgba(0,0,0,0.3);
     color:#fefee9;
     border:0.2px solid #2299ff;
     background-repeat:repeat;
     background-size:auto;
     background-origin:padding-box;
     background-clip:padding-box;
     background-color:#3399ff;
     background: linear-gradient(to bottom, #eeeff9 0%,#3399ff 100%);
}
 
.yongyin:hover {
    background: #268DFF;
}
</style>
<style type="text/css">
.load{
  width: 100%;
  height: 100vh;
  position: fixed;
  top: 0;
  z-index: 10000;
  //display: none;
  background-color: rgba(0, 0, 0, 0.1);
}
.loader{
  width: 140px;
  height: 140px;
  /* border: 1px solid red; */
  text-align: center;
  position: absolute;
  top: calc(50% - 70px);
  left: calc(50% - 70px);
  padding-top: 15px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
}
#loader-1{
  width: 60px;
  height: 60px;
}
.load-msg{
  height: 50px;
  line-height: 50px;
  color: #fff;
  font-size: 13px;
  /* margin-top: 20px; */
}
svg path, svg rect {
  fill: #17a085;
}
</style>
    </head>   
    <body>
<div class="load" style="display: none">
  <div class="loader" title="2">
    <svg version="1.1" id="loader-1"  x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
      <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
        <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />
      </path>
    </svg>
    <div class="load-msg"> 上传中,请稍后....</div>
  </div>
</div>
	<div class="upload" id="upload_picture" data-num="20" data-name="picture" data-type="jpg,jpeg,png,gif" action="upload.php" data-save="/upload/image/{Y}_{M}/{D}_{H}{I}{S}{Rnd}.{Ext}" ></div>
	<button class="up" οnclick="return false" id="btn">开始上传图片</button>
		<script type="text/javascript" src="/Public/upload/js/jquery.min.js"></script>
		<script type="text/javascript" src="/Public/upload/js/upload.js"></script>
        <script type="text/javascript">		
		$(document).ready(function(){
		ciy_alertautoheight();
	    $("#upload_picture").upload();
		function ciy_alertautoheight()
			{
				var sitime = setInterval(function(){
				   if(!window.alertautoheight)
					   return;
				   clearInterval(sitime);
				   window.alertautoheight(document.body.clientHeight);
			   },100);
			}
		});
		
$("#btn").click(function(){
	img = " input[ name='picture' ] ";
	$("#test").html($(img).val());
	imgs = $(img).val();
$(".load").show();
$.ajax({
    type: "POST",
    url: "<?php echo U('Api/img_post');?>", 
    data:'imgs='+imgs, 
    success: function(data){ 
    	$(".load").hide();
          if(data){
          alert(data);
        }else{
        	$(".load").hide();
        alert(data);
        }      
      }
    });

		})
        </script>
    </body>

</html>